package com.csist.controller;/**
 * Description:
 *
 * @author YF
 * @date 2024/6/17 08:47
 */

import com.csist.pojo.Computer;
import com.csist.service.ComputerService;
import com.csist.service.impl.ComputerServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/main")
public class interServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String type = request.getParameter("type");
        ComputerService computerService=new ComputerServiceImpl();
        List<Computer> computers = computerService.selectAll();
        request.setAttribute("list",computers);
        request.getRequestDispatcher("/headPage/inter.jsp").forward(request,response);
    }
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}